/**
 * @author BoLiang
 */
if (typeof accedo === "undefined") {
	accedo = {};
}
if (typeof accedo.achievement === "undefined") {
	accedo.achievement = {};
}

accedo.achievement.achiPortalFriendsMain = {

	portalFriMainNode : null,

	appendFriendsListPage : function(username) {
		var mainCtnNode = document.getElementById("achiPortalMainCtn");
		mainCtnNode.className = "portalFriMainCtnMoveLeft";
		var achiPortalMainNode = document.getElementById("achiPortalMain");

		setTimeout(
			function() {
				achiPortalMainNode.removeChild(mainCtnNode); 
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode = document.createElement("div");
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.id = "achiPortalMainCtn";
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.className = "portalFriMain";
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsList.createFriListMain(username));
				// accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsSearch.appendFriendsSearchDiv());
				// this.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsDetail.appendFriendsDetailDiv(username));
				achiPortalMainNode.appendChild(accedo.achievement.achiPortalFriendsMain.portalFriMainNode); 

				
			}
			, 500
		);

		// setTimeout(
		// 	function() {
		// 		achiPortalMainNode.removeChild(accedo.achievement.achiPortalShow.mainCtnNode); 
		// 		accedo.achievement.achiPortalShow.mainCtnNode = document.createElement("div");
		// 		accedo.achievement.achiPortalShow.mainCtnNode.className = "portalFriMain";
		// 		accedo.achievement.achiPortalShow.mainCtnNode.appendChild(accedo.achievement.achiPortalFriendsList.createFriListMain(username));
		// 		// accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsSearch.appendFriendsSearchDiv());
		// 		// this.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsDetail.appendFriendsDetailDiv(username));
		// 		achiPortalMainNode.appendChild(accedo.achievement.achiPortalShow.mainCtnNode); 

				
		// 	}
		// 	, 500
		// );

		

	},

	appendFriendsSearchPage : function(username) {
		var mainCtnNode = document.getElementById("achiPortalMainCtn");
		mainCtnNode.className = "portalFriMainCtnMoveLeft";
		var achiPortalMainNode = document.getElementById("achiPortalMain");

		setTimeout(
			function() {
				achiPortalMainNode.removeChild(mainCtnNode); 
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode = document.createElement("div");
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.id = "achiPortalMainCtn";
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.className = "portalFriMain";
				// accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsList.createFriListMain(username));
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsSearch.appendFriendsSearchDiv(username));
				// this.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsDetail.appendFriendsDetailDiv(username));
				achiPortalMainNode.appendChild(accedo.achievement.achiPortalFriendsMain.portalFriMainNode); 

				
			}
			, 500
		);

		

	},

	appendProtalMainPage : function(username) {
		var mainCtnNode = document.getElementById("achiPortalMainCtn");
		mainCtnNode.className = "portalFriMainCtnMoveLeft";
		var achiPortalMainNode = document.getElementById("achiPortalMain");

		setTimeout(
			function() {
				achiPortalMainNode.removeChild(mainCtnNode); 
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode = document.createElement("div");
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.id = "achiPortalMainCtn";
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.className = "portalFriMain";
				// accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsList.createFriListMain(username));
				accedo.achievement.achiPortalFriendsMain.portalFriMainNode.appendChild(accedo.achievement.achiPortalShow.appendMainCtnNode(username));
				// this.portalFriMainNode.appendChild(accedo.achievement.achiPortalFriendsDetail.appendFriendsDetailDiv(username));
				achiPortalMainNode.appendChild(accedo.achievement.achiPortalFriendsMain.portalFriMainNode); 

				
			}
			, 500
		);

		

	}



};